import React, {useEffect} from 'react'
import {GetServerSideProps, } from 'next'
import cookie from 'react-cookies'

export default function JyDemo1() {
  useEffect(() => {
    let inFifteenMinutes = new Date(new Date().getTime() + 24 * 3600 * 1000);//一天
    cookie.save('userId', "123",{ path: '/', expires: inFifteenMinutes })
    cookie.save('userInfo', {name: 'tlx'}, { path: '/' })
  }, [])
  return (
    <div>JyDemo1</div>
  )
}

export const getServerSideProps: GetServerSideProps = async (context) => {
  const params = context.params
  let allData = {}
  try {
    
  } catch (error) {
    
  }
  console.log("cookie -->", context.req.headers.cookie )
  return {
    props: {
      data: []
    }
  }
}